import type { RouteRecordRaw, RouteLocationNormalized } from 'vue-router'; // RouteLocationNormalized

const gateruler: RouteRecordRaw[] = [
  {
    path: '/gaterulercard',
    name: 'GateRulerCardPage',
    component: () => import('/@/views/gateruler/card'),
    meta: {
      title: '单卡',
    },
  },
  {
    path: '/gaterulercard/:id',
    name: 'GateRuleCardDetailPage',
    component: () => import('/@/views/gateruler/card-detail'),
    meta: {
      title: '单卡详情',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        id: router.params.id ? String(router.params?.id) : 0,
      };
    },
  },
  {
    path: '/gaterulerdeck',
    name: 'GateRulerDeckPage',
    component: () => import('/@/views/gateruler/deck'),
    meta: {
      title: '套牌',
    },
  },
  {
    path: '/gaterulerdeck/:id',
    name: 'GateRulerDeckDetailPage',
    component: () => import('/@/views/gateruler/deck-detail'),
    meta: {
      title: '套牌详情',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        id: router.params.id ? String(router.params?.id) : 0,
        share: router.query.share || '',
      };
    },
  },
  {
    path: '/gaterulecreate/:id?',
    name: 'GateRulerDeckCreatePage',
    component: () => import('/@/views/gateruler/deck-create'),
    meta: {
      title: '创建套牌',
    },
    props: (router: RouteLocationNormalized) => {
      return {
        id: router.params.id ? String(router.params?.id) : '',
      };
    },
  },
  {
    path: '/gaterulerdeckcard/',
    name: 'GateRulerDeckCardPage',
    component: () => import('/@/views/gateruler/deck-card'),
    meta: {
      title: '选择卡牌',
    },
  },
];

export default gateruler;
